<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="https://cdn.staticfile.org/vue/2.5.17/vue.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.13.0/theme-chalk/index.css" />
  <script src="https://cdn.staticfile.org/element-ui/2.13.0/index.js"></script>
  <link rel="stylesheet" href="https://cdn.staticfile.org/animate.css/3.7.0/animate.min.css" />
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    <el-button size="small" @click.native="startRecord">开始</el-button>
    <el-button size="small" type="danger" @click="stopRecord">停止</el-button>
    <el-button size="small" type="warning" @click="getRecord">捕捉</el-button>
    <br /> <br />
    <avue-video background="https://avuejs.com/images/face.png" @data-change="dataChange" ref="video"></avue-video>
  </div>
</body>
<script>
  new Vue({
    el: '#app',
    methods: {
      startRecord() {
        this.$refs.video.startRecord();
      },
      stopRecord() {
        this.$refs.video.stopRecord();
      },
      getRecord() {
        this.$refs.video.getRecord();
      },
      dataChange(data) {
        console.log(data);
      }
    }
  })
</script>

</html>